package geektime.concurrent.part2.race;

/**
 * 线程比赛的测试类
 */
public class ThreadRace {

    public static void main(String[] args) throws InterruptedException {
        long singleThreadTimeCost = new SingleThreadPlayer().genRandomNumbersAndCompute();
        long multiThreadTimeCost = new MultiThreadPlayer().genRandomNumbersAndCompute();
        System.out.println("-------------比较结果-------------");
        System.out.println("多线程操作总耗时/单线程总耗时=" + (double) multiThreadTimeCost / singleThreadTimeCost);
    }
}
